<!DOCTYPE HTML>

<html lang="pt-br" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
<ui:composition template="/view/Principal.xhtml">
<ui:define name="corpo">

<style type="text/css">
.form-signin {
	max-width: 1024px;
	padding: 5px 5px 5px;
	margin: 0 auto 10px;
	background-color: #FFFFFF;
	border: 1px solid #FFFFFF;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.expansao {
	background-color: #4682B4;
	color: #FFFFFF;
	font-size: 10px;
	font-style: italic;
}
</style>
	<div class="container">
	
		<h:form id="form" styleClass="form-signin">
			<p:growl id="growl" 
					showDetail="true" 
					sticky="true" 
					autoUpdate="true"/>
					
			<h4 class="form-signin-heading" 
				id="cabecalho">Transportadoras - Gerenciamento</h4>
				
			<p:panel header="Filtros por Período" 
					id="pnlFiltros">
				
				<p:panelGrid columns="3" 
							style="vertical-align:middle;">	
							
				<p:selectOneMenu id="itemMesFiltro"
								value="#{managementCarriesBean.mes}"
								required="true"
								requiredMessage="Selecione mês para filtro">
					<f:selectItems value="#{managementCarriesBean.meses}"/>
				</p:selectOneMenu>
				
				<p:selectOneMenu id="itemAnoFiltro"
								value="#{managementCarriesBean.ano}"
								required="true"
								requiredMessage="Selecione ano para filtro">
					<f:selectItems value="#{managementCarriesBean.anos}"/>
				</p:selectOneMenu>
				
				
				<p:commandButton id="btnAtualizar" 
								value="Atualizar Dados da Tela" 
								actionListener="#{managementCarriesBean.carregarDadosTela}" 
								update="panelGrid"
								process="@all"
								styleClass="ui-priority-primary"/>
								
				</p:panelGrid>
							
			</p:panel>
			<p:panel id="panelGrid">
				<p:accordionPanel>
					<p:tab title="Informações Gerais">
						<p:dataTable id="masterVendas"
							var="volumePorTransportadora"
							value="#{managementCarriesBean.listaVolumesPorTransportadora}"
							emptyMessage="Sem dados para exibição"
							style="font-size:11px;">
								
								 <f:facet name="header">  
            							Lista de transportadoras 
       							</f:facet>
									
								<p:column id="colunaRazaTransportadora"
										headerText="Transportadora"
										footerText="Totais de Volume e Frete:"
										style="width:55%; 
										text-align:left;">
											<h:outputText value="#{volumePorTransportadora.transportadorBean.razao}"/> 
								</p:column>
								
								<p:column id="colunaQuantidadeVolume" 
										headerText="Qtd. Vol."
										footerText="#{managementCarriesBean.vendaBean.quantidadeVolumeGeral}"
										style="width:10%;
										text-align:center;">
											<h:outputText value="#{volumePorTransportadora.quantidadeVolume}"/>
								</p:column>
				
								<p:column id="colunaValorFrete" 
										headerText="Valor Frete"
										footerText="#{managementCarriesBean.vendaBean.valorFreteGeral}"
										style="width:10%; 
										text-align:center;">
											<h:outputText value="#{volumePorTransportadora.valorFrete}"/>
								</p:column>
								<f:facet name="footer">
									<p:commandButton id="btnImprimir"
												icon="ui-icon-print"
												title="Imprimir"
												ajax="false"
												onclick="this.form.target='_blank'"
												actionListener="#{managementCarriesBean.imprimir}"/>
								</f:facet>
							</p:dataTable>	
					</p:tab>
					<p:tab title="Gráfico">
						<p:pieChart id="graficoTransportadora"
								value="#{managementCarriesBean.pieChartModel}"
								legendPosition="s"
								style="width:850px;height:500px"
								legendRows="8"
								sliceMargin="5">
						</p:pieChart>
					</p:tab>
				</p:accordionPanel>	
			</p:panel>
			
				
		</h:form>
	</div>
</ui:define>
</ui:composition>
</html>